////////////////////////////////////////////////////////////////////////////////
//
//  http://www.17nce.com
//  Copyright 2011-2012 
//  All Rights Reserved.
//
//  gtshao@sina.cn  2010-12-23
//
////////////////////////////////////////////////////////////////////////////////
package com.nce
{
	import com.nce.controller.StartupCommand;
	
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;

	/**
	 * 
	 */
	public class ApplicationFacade extends Facade implements IFacade
	{
		
		public static const STARTUP:String 			= "startup";	
		public static const CHANGE_LESSON:String       ="changeLesson";  
		public static const GET_LESSONS:String       ="getLessons"; 
		public function ApplicationFacade()
		{
		}
		
		/**
		 * Singleton Factory Method
		 */
		public static function getInstance() : ApplicationFacade {
			if ( instance == null ) instance = new ApplicationFacade( );
			return ApplicationFacade( instance ) ;
		}
		
		/**
		 * Start the application
		 */
		public function startup( app:Nce ):void
		{
			sendNotification( STARTUP, app );	
		}
		
		/**
		 * Register Commands with the Controller 
		 */
		override protected function initializeController( ) : void 
		{
			trace("initializeController");
			super.initializeController();			
			registerCommand( STARTUP, StartupCommand );
//			registerCommand( DELETE_USER, DeleteUserCommand );
//			registerCommand( ADD_ROLE_RESULT, AddRoleResultCommand );
		}
	}
}